<div class="personData-box"  ng-controller="personalDataController">
  <div class="personData-content">
      <!--基本资料-->
      <div class="basicInformation">
          <div class="person-base-Box">
                  <p><i>基本资料</i><a href="javascript:void(0)"  data-toggle="modal" data-target="#updateUser" ng-click="UpdateUserInit()">修改资料</a></p>
                  <p><lable>姓名：</lable><span ng-bind="getCurrenUser.userName"></span></p>
                  <p><lable>手机号：</lable><span ng-bind="getCurrenUser && getCurrenUser.bindMobile ? (getCurrenUser.bindMobile==1?getCurrenUser.mobile:'未绑定') : '未绑定'"></span></p>
                  <p><lable>工号：</lable><span ng-bind="getCurrenUser.jobNum"></span></p>
                  <p><lable>部门：</lable><span ng-bind="getCurrenUser.department"></span></p>
                  <p><lable>职位：</lable><span ng-bind="getCurrenUser.job"></span></p>
                  <p><lable>邮箱：</lable><span ng-bind="!getCurrenUser.bindEmail || getCurrenUser.email=='undefined' ? '未绑定': (getCurrenUser.bindEmail==1?getCurrenUser.email:'未绑定') "></span></p>
                  <p class="user_JBput">
                      <lable>警报推送:</lable>
                      <span>
                          <input type="radio" ng-model="getCurrenUser.removeAlert" name="removeAlertList" ng-value="0" ng-checked="getCurrenUser.removeAlert=='0'?true:false" disabled/><i>允许推送（手机，邮箱）</i>
                          <input type="radio" ng-model="getCurrenUser.removeAlert" name="removeAlertList" ng-value="1" ng-checked="getCurrenUser.removeAlert=='1'?true:false" disabled/><i>邮箱</i>
                          <input type="radio" ng-model="getCurrenUser.removeAlert"  name="removeAlertList" ng-value="2" ng-checked="getCurrenUser.removeAlert=='2'?true:false" disabled/><i>不允许</i>
                      </span>
                  </p>
              </div>
      </div>

      <!--安全资料-->
      <div class="securityInformation">
          <div class="security-base-Box">
              <p class="securityInfo-title">安全资料</p>
              <div class="security-conbox">
                  <div class="email-conbox">
                      <p><i>邮箱绑定</i></p>
                      <p><input type="text" placeholder="输入邮箱" id="txt_email"  style="width: 170px;" /></p>
                      <p>
                          <input type="text" placeholder="输入验证码" id="txt_email_code" style="width: 90px;"/>
                          <!--<input type="button" name="btncode" class="user-send-code" id="sendEmailCode" value="获取验证码"  onclick="settime_email(this)"  ng-click="getEmailCode()" disabled/>-->
                          <input type="button" name="btncode" class="user-send-code" id="sendEmailCode" value="获取验证码"  ng-click="getEmailCode()" disabled/>
                      </p>
                      <p><input type="button" value="绑定" class="bind-btn" ng-click="BindUserEmail();"/></p>
                  </div>
                  <div class="phone-conbox">
                      <p><i>绑定手机</i></p>
                      <p><input type="text" placeholder="输入手机号" id="txt_mobile" style="width: 170px;" /></p>
                      <p>
                          <input type="text" placeholder="输入验证码" id="txt_mobile_code"  style="width: 90px;"/>
                          <!--<input type="button" name="btncode" class="user-send-code" value="获取验证码" id="sendMobeliCode"  onclick="settime_mobile()" ng-click="getMobileCode()" disabled/>-->
                          <input type="button" name="btncode" class="user-send-code" value="获取验证码" id="sendMobeliCode"  ng-click="getMobileCode()" disabled/>
                      </p>
                      <p><input type="button" value="绑定" class="bind-btn" ng-click="BindUserMobile();" /></p>
                  </div>
                  <div class="password-conbox">
                      <p><i>密码</i></p>
                      <p><a href="javascript:void(0)"  data-toggle="modal" data-target="#updateUserPwd" ng-click="UpdateUserPwdInit()">修改密码</a></p>
                  </div>
                  <div class="clear" style="clear: both"></div>
              </div>
          </div>
      </div>

      <!-- Modal updateUser-->
      <div id="updateUser" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="updateUserLabel"
           aria-hidden="true">
          <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
              <h4 id="updateUserLabel">修改个人信息</h4>
          </div>
          <div class="modal-body">
              <div class="container" style="width:500px; padding-bottom:20px">
                  <div class="add-user-model1">
                      <p>
                          <span>姓名：</span><input type="text" ng-model="getCurrenUser.userName" placeholder="必填"/>
                          <!--<span>性别：</span>-->
                          <!--<input type="radio" name="sex" value="男" ng-model="getCurrenUser.gender" />男-->
                          <!--<input type="radio" name="sex" value="女"  ng-model="getCurrenUser.gender" />女-->
                          <span>工号：</span><input type="text" ng-model="getCurrenUser.jobNum" placeholder="必填"/>
                      </p>
                      <p>
                          <span>部门：</span> <input type="text" ng-model="getCurrenUser.department" placeholder="必填"/>
                          <span>职位：</span> <input type="text" ng-model="getCurrenUser.job" placeholder="必填"/>
                      </p>
                      <!--<p>-->
                          <!--<span>固定电话：</span> <input type="text" ng-model="getCurrenUser.telephone" placeholder="选填" />-->
                      <!--</p>-->
                      <p class="user_JBput">
                          <span>警报推送:</span>
                          <input type="radio" ng-model="getCurrenUser.removeAlert"  name="removeAlert" value="0"/><i>允许推送（手机，邮箱）</i>
                          <input type="radio" ng-model="getCurrenUser.removeAlert"  name="removeAlert" value="1" /><i>邮箱</i>
                          <input type="radio" ng-model="getCurrenUser.removeAlert"  name="removeAlert" value="2" /><i>不允许</i>
                      </p>
                  </div>
              </div>
          </div>
          <div class="modal-footer">
              <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
              <button class="btn btn-primary"  data-dismiss="modal" aria-hidden="true" ng-click="saveUpdateUserInfo()">保 存</button>
          </div>
      </div>

      <!-- Modal updateUser-->
      <div id="updateUserPwd" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="updateUserPwdLabel"
           aria-hidden="true">
          <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
              <h4 id="updateUserPwdLabel">修改密码</h4>
          </div>
          <div class="modal-body">
              <div class="container" style="width:518px; ">
                  <div class="add-user-model1" id="testDiv">
                       <p><span>原密码：</span> <input type="password" id="oldPwd" class="testClass" width="150"/><i> * 必填</i></p>
                       <p><span>新密码：</span> <input type="password" id="newPwd"class="testClass" /><i> * 必填</i></p>
                       <p><span>确认新密码：</span> <input type="password" id="sure-newPwd" class="testClass" /><i> * 必填（两次密码必须保持一致）</i></p>
                  </div>
              </div>
          </div>
          <div class="modal-footer">
              <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
              <button class="btn btn-primary"  ng-click="saveUpdateUserPwd()">保 存</button>
          </div>
      </div>
  </div>
</div>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script>
    $(function () {
        $("#txt_email").bind('input propertychange',function () {
            var l = $("#txt_email").val().length;
            if(l && l>0){
                $("#sendEmailCode").attr("disabled",false);
            }else{
                $("#sendEmailCode").attr("disabled",true);
            }
        });
        $("#txt_mobile").bind('input propertychange',function () {
            var l = $("#txt_mobile").val().length;
            if(l && l>0){
                $("#sendMobeliCode").attr("disabled",false);
            }else{
                $("#sendMobeliCode").attr("disabled",true);
            }
        });
    });
    var countdown = 60;
    function settime_email(val) {
        if (countdown == -1) {
             val.removeAttribute("disabled");
             val.value="获取验证码";
            return false;

        } else {
            val.setAttribute("disabled", true);
            val.value="重新发送(" + countdown + ")";
            countdown--;
        }
        setTimeout(function() {
            settime_email(val)
        },1000)
    }
    function settime_mobile(val) {
        if (countdown == -1) {
            val.removeAttribute("disabled");
            val.value="获取验证码";
            return false;

        } else {
            val.setAttribute("disabled", true);
            val.value="重新发送(" + countdown + ")";
            countdown--;
        }
        setTimeout(function() {
            settime_mobile(val)
        },1000)
    }
</script>
<script>
    $(document).ready(function(){
        $("#testDiv :input[class='testClass']").keypress(function(e) {
            var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
            if (keyCode == 39) // 判断所按是否方向右键
            {
                keyCode == 9;
            }
            if (keyCode == 13) // 判断所按是否回车键 FireFox下事件的keyCode 是只读的，不能修改
            {
                keyCode == 9;
                var inputs = $("#testDiv :input[class='testClass']"); // 获取表单中的所有输入框
                var idx = inputs.index(this); // 获取当前焦点输入框所处的位置

                if (idx == inputs.length - 1) // 判断是否是最后一个输入框
                {
                    return false;// 取消默认的提交行为
                } else {
                    inputs[idx + 1].focus(); // 设置焦点
                    inputs[idx + 1].select(); // 选中
                }
                return false;// 取消默认的提交行为
            }
        });
    })

</script>